package com.mcp.converter.shared.response.analysis;

import com.mcp.converter.domain.checker.IncompatiblePoint;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 分析响应类
 * @author zengxiong
 */
@Data
public class AnalysisResponse {
    private String originalSql;
    private boolean compatible;
    private int incompatibilityCount;
    private String reportId;
    private List<String> criticalIssues = new ArrayList<>();
    private List<String> conversionSuggestions = new ArrayList<>();
    private List<IncompatiblePoint> detailedAnalysis = new ArrayList<>();
    private List<IncompatibilityDetail> incompatibilityDetails = new ArrayList<>();
    
    public void addIncompatibilityDetail(IncompatibilityDetail detail) {
        this.incompatibilityDetails.add(detail);
    }
    
    public void setIncompatiblePointCount(int count) {
        this.incompatibilityCount = count;
    }
    
    public int getIncompatiblePointCount() {
        return this.incompatibilityCount;
    }
    
    /**
     * 不兼容性详情
     */
    @Data
    public static class IncompatibilityDetail {
        private String type;
        private String element;
        private String reason;
        private String suggestion;
        private String position;
    }
}